<!doctype html>
<html>
<head>
<meta charset="utf-8">
	<title><?php echo isset($site_title)?$site_title:"";?>-注册</title>
<link href="<?php echo urldecode(Url::urlFormat("#qhf/font/iconfont.css"));?>" rel="stylesheet"/>
<link href="<?php echo urldecode(Url::urlFormat("#qhf/lian.css"));?>" rel="stylesheet" type="text/css"/>

<link href="<?php echo urldecode(Url::urlFormat("#css/bootstrap.css"));?>" rel="stylesheet" type="text/css"/>
<script src="<?php echo urldecode(Url::urlFormat("#js/jquery.min.js"));?>"></script>
<script src="<?php echo urldecode(Url::urlFormat("#js/bootstrap.js"));?>"></script>



</head>
<body class="y-body">
	<div class="container">
		<div class="logo" style="top:0px;left:302px;">
			<a href="<?php echo urldecode(Url::urlFormat("/index/index"));?>">
			<img src="<?php echo urldecode(Url::urlFormat("@$site_logo"));?>" alt="logo" width="155px" height="76px">
			</a>
			<!--<span class="logo-text">商城</span>-->
		</div><!--logo结束-->
		<div class="y-container">
			<form action="<?php echo urldecode(Url::urlFormat("/simple/reg_act"));?>" method="post" id="reg_form">
              <div class="y-container-et">
                   <div class="y-container-at">
					   <h4 class="y-container-at1"><a href="#" style="font-size:25px;">用户注册</a></h4>
					    
					   <h5 class="y-container-at2"><a href="<?php echo urldecode(Url::urlFormat("/simple/login"));?>">会员登录</a></h5>
					   
				   </div><!--y-container-at结束-->
				   
				   
				   <div class="d-container-bt" id="div_msg" style="font-size:16px;color:red;width:310px;height:20px;text-align:center;line-height:20px;margin-top:10px;">
				   </div>
				   
				   <div class="y-container-qt">
                        <div class="y-container-left">
							<i class="iconfont icon-shoujihao"></i>
						</div><!--y-container-left结束-->
					    <div class="y-container-right">
							<input type="text" class="y-container-right-1" name="number" id="number" value="<?php echo isset($tjr_number)?$tjr_number:"";?>" placeholder="推荐编码">
						</div><!--y-container-right结束-->
						<!-- 
					   <div class="y-container-bt">
						   格式不正确！
					   </div>
					   -->
				   </div><!--y-container-qt结束-->
				  <div class="y-container-qt">
					  <div class="y-container-left">
						  <i class="iconfont icon-shoujihao1"></i>
					  </div><!--y-container-left结束-->
					  <div class="y-container-right">
						  <input type="text" name="uname" id="uname" class="y-container-right-1" placeholder="请输入手机号">
					  </div><!--y-container-right结束-->
				  </div><!--y-container-qt结束-->
				  <div class="y-container-qt">
					  <div class="y-container-left">
						  <i class="iconfont icon-mima"></i>
					  </div><!--y-container-left结束-->
					  <div class="y-container-right">
						  <input type="password" name="password" id="password" class="y-container-right-1" placeholder="请输入登录密码">
					  </div><!--y-container-right结束-->
				  </div><!--y-container-qt结束-->
				  <div class="y-container-qt">
					  <div class="y-container-left">
						  <i class="iconfont icon-mima1"></i>
					  </div><!--y-container-left结束-->
					  <div class="y-container-right">
						  <input type="password" name="passwordtwo" id="passwordtwo" class="y-container-right-1" placeholder="请输入交易密码">
					  </div><!--y-container-right结束-->
				  </div><!--y-container-qt结束-->
				  <div class="y-container-qt">
					  <div class="y-container-left">
						  <i class="iconfont icon-duanxinyanzheng"></i>
					  </div><!--y-container-left结束-->
					  <div class="y-container-right-3">
						  <input type="text" name="validate_code" id="validate_code" class="y-container-right-2" style="border:1px solid #c2c2c2;height:38px;" placeholder="手机验证码">
						  &nbsp;
						  <input type="button" onclick="get_validate_code()" value="获取手机验证码" style="cursor:pointer;width:118px;height:38px;color:#fff;font-size:13px;border:1px solid red;font-weight: bold ;background-color:#f35035;margin-left:-12px;"/>
						  <!-- 
						  <div class="y-container-right-mit">
							  获取手机验证码
						  </div>
						  -->
					  </div><!--y-container-right结束-->

				  </div>
				  <!-- 
				  <div class="y-container-qt">
					  <div class="y-container-left">
						  <i class="iconfont icon-duanxinyanzhengma"></i>
					  </div>
					  <div class="y-container-right-3">
						  <input type="text" name="verifyCode" id="verifyCode" class="y-container-right-2" style="border:1px solid #c2c2c2;height:38px;" placeholder="请输入验证码">
					  </div>
					  <div class="y-container-right-mid">
					  	  <a href="javascript:void(0)" class="red" onclick="document.getElementById('captcha_img').src='<?php echo urldecode(Url::urlFormat("/simple/captcha/h/40/w/100/bc/f1f1f1/random/"));?>'+Math.random()">
						 	<img id="captcha_img"  src="<?php echo urldecode(Url::urlFormat("/simple/captcha/h/34/w/100/bc/f1f1f1"));?>">
						 </a>	
					  
					  	  
					  </div>
				  </div>
				  -->
				  
				  <div class="y-container-qt">
					  <div	class="y-container-nt">
						  <input type="checkbox" id="chk_read_me">我已阅读并同意 &lt;&lt;<a id="user-license" style="color:red;" href="javascript:;"> <?php echo isset($site_title)?$site_title:"";?>用户注册协议 </a>&gt;&gt;
					  </div><!--y-container-nt-->
				  </div><!--y-container-qt结束-->
				  <div class="y-container-qt" style="margin-top:10px;">
                       <button type="button" class="y-container-btn" style="background:red;cursor:pointer;" id="btn_reg">立即注册</button>
				  </div><!--y-container-qt结束-->
			  </div><!--y-container-et结束-->
			  <input type='hidden' name='tiny_token_reg' value='<?php echo Tiny::app()->getToken("reg");?>'/>
			  </form>
		</div><!--y-container结束-->
		<div class="y-footer">
			<div class="y-footer-lt">
				<ul>
					<li><a href="#">关于我们</a>&nbsp;|</li>
					<li><a href="#">联系我们</a>&nbsp;|</li>
					<li><a href="#">人才招聘</a>&nbsp;|</li>
					<li><a href="#">商家入驻</a>&nbsp;|</li>
					<li><a href="#">广告服务</a>&nbsp;|</li>
					<li><a href="#">手机创云</a>&nbsp;|</li>
					<li><a href="#">友情链接</a>&nbsp;|</li>
					<li><a href="#"></a>销售联盟&nbsp;</li>
				</ul>
			</div><!--y-footer-lt结束-->
			<!-- 
			<div class="y-footer-mt">
				Copyright © 2017 汇圆版权所有
			</div>
			-->
			<div class="y-footer-rt">
				<ul>
					 <li><img src="<?php echo urldecode(Url::urlFormat("#qhf/image/c.jpg"));?>" alt=""></li>
					 <li><img src="<?php echo urldecode(Url::urlFormat("#qhf/image/b.jpg"));?>" alt=""></li>
					 <li><img src="<?php echo urldecode(Url::urlFormat("#qhf/image/d.jpg"));?>" alt=""></li>
				</ul>
			</div><!--y-footer-rt结束-->
		</div><!--footer结束-->
	</div><!--container结束-->




<!-- 
<div id="license-content" style="display:none;">
    <div style="height:400px;overflow:auto">
    <?php $item=null; $query = new Query("help");$query->where = "id = 14";$items = $query->find(); foreach($items as $key => $item){?>
    <?php echo isset($item['content'])?$item['content']:"";?>
    <?php }?>
    </div>
    <div class="mt10 tc"><a href="javascript:closeLicense();" class="btn btn-main">同意用户注册协议</a></div>
</div>
-->


<div class="modal fade" id="myModal_1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">注册协议：</h4>
            </div>
            <div class="modal-body" id="myModalContent">
                <div class="form-horizontal" data-validate="parsley">
                	<?php $item=null; $query = new Query("help");$query->where = "id = 14";$items = $query->find(); foreach($items as $key => $item){?>
						<?php echo isset($item['content'])?$item['content']:"";?>
			        <?php }?>
                	<!-- 
                    <section class="panel panel-default">

                        <div class="panel-body">			
							
                        </div>
                    </section>
                    -->
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>



<script type="text/javascript">
<?php if(!empty($invalid)){?>
$("#div_msg").text("<?php echo isset($invalid[msg])?$invalid[msg]:"";?>")
<?php }?>

function show_msg( msg )
{
	$("#div_msg").text(msg);
	setTimeout(function(){
		$("#div_msg").text('');
	},3000);
}

$("#user-license").on("click",function(){
	$("#myModal_1").modal();    
});

$("#btn_reg").click(function()
{
	//推荐编码
	var number        = $.trim( $("#number").val() );
	var uname         = $.trim( $("#uname").val() );
	var password      = $.trim( $("#password").val() );
	var passwordtwo   = $.trim( $("#passwordtwo").val() );
	var validate_code = $.trim( $("#validate_code").val() );
	//var verifyCode    = $.trim( $("#verifyCode").val() );
	
	if(number == '')
	{
		show_msg('推荐编码不能为空');
		return;
	}
	/*
	if(number != '')
	{
		var pattern = /^\w{6}$/i;
		if(!pattern.test( number ))
		{
			show_msg('您输入的推荐编码不合法');
			return;
		}
	}
	*/
	
	if(uname == '')
	{
		show_msg('手机号码不能为空');
		return;
	}
	var pwd_pattern = /^\w{6,20}$/i;
	if(password == '')
	{
		show_msg('登录密码不能为空');
		return;
	}
	
	if(!pwd_pattern.test( password ))
	{
		show_msg('您输入的登录密码不合法');
		return;
	}
	
	if(passwordtwo == '')
	{
		show_msg('交易密码不能为空');
		return;
	}
	
	if(!pwd_pattern.test( passwordtwo ))
	{
		show_msg('您输入的交易密码不合法');
		return;
	}
	
	
	if(validate_code == '')
	{
		show_msg('短信验证码不能为空');
		return;
	}
	
	if(!(/^\d{6}$/.test( validate_code )))
	{
		show_msg('您输入的短信验证码不合法');
		return;
	}
	
	/*
	if(verifyCode == '')
	{
		show_msg('验证码不能为空');
		return;
	}
	
	if( !(/^[a-z]{4}$/.test(verifyCode)) )
	{
		show_msg('您输入的验证码不合法');
		return;
	}
	*/
	
	if( !$("#chk_read_me").prop('checked') )
	{
		show_msg('您必须选择同意用户注册协议');
		return;
	}
	
	$("#reg_form").submit();
});



function get_validate_code()
{
	var mobile = $.trim($("#uname").val());
	if(mobile == '')
	{
		alert('手机号码不能为空');
		return;
	}
	var mobile_pattern = /^1[3-9]\d{9}$/;
	if(!mobile_pattern.test(mobile))
	{
		alert('手机号码不合法');
		return;
	}
	
	$("#btn_get_validate").attr("disabled", true);
	$.post("<?php echo urldecode(Url::urlFormat("/simple/sms_send"));?>",{mobile:mobile},function(result){
	      alert(result);
	      $("#btn_get_validate").attr("disabled", false);
	  });
}


</script>


</body>
</html>


<!--Powered by TinyRise-->